<%@ page language="java" contentType="text/html; charset=UTF-8" isErrorPage="true" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="pagePath" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="${pagePath}/page/static/css/reset.css">
<link rel="stylesheet" type="text/css" href="${pagePath}/page/static/css/main.css">
<script type="text/javascript" src="${pagePath}/page/static/js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="${pagePath}/page/static/js/jquery-ui.min.js"></script>
<script type="text/javascript" src="${pagePath}/page/static/js/slide.js"></script>
<title>校园二手交易网-任务区</title>
</head>
<body>
	<div class="header_con">
		<div class="header">
			<div class="welcome fl">欢迎来到 校园二手交易网！</div>
			<div class="fr">
				<div class="user_link fl">
					<c:if test="${!empty loguser}">
						欢迎您：<em style="color: red;">${loguser.username}</em>
						<span>|</span>
						<a href="${pagePath}/logout.do">退出</a>
					</c:if>
				</div>
				<div class="login_btn fl">
					<c:if test="${empty loguser}">
						<span style="color: red;">${message}</span>
						<a href="${pagePath}/login.do">登录</a>
						<span>|</span>
						<a href="${pagePath}/register.do">注册</a>
					</c:if>
				</div>
			</div>
		</div>
	</div>
	<div class="search_bar clearfix">
		<a href="${pagePath}/index.do" class="logo fl"><img src="${pagePath}/page/static/images/logo.png"></a>
		<div class="search_con fl">
			<form action="${pagePath}/task.do">
				<input type="text" class="input_text fl" id="key" name="key" placeholder="搜索商品" required="required"> <input type="submit" class="input_btn fr" value="搜索">
			</form>
		</div>
		<div class="guest_cart fr">
			<a href="${pagePath}/cart.do" class="cart_name fl">我的购物车</a>
		</div>
	</div>
	<div class="navbar_con">
		<div class="navbar">
			<h1 class="fl">任务区</h1>
			<ul class="navlist fl">
				<li><a href="${pagePath}/index.do" class="active">商品区</a></li>
				<li class="interval">|</li>
				<li><a href="${pagePath}/index_task.do">任务区</a></li>
				<li class="interval">|</li>
				<li><a href="${pagePath}/personal_info.do">个人中心</a></li>
				<li class="interval">|</li>
				<li><a href="${pagePath}/cart.do">购物车</a></li>
			</ul>
		</div>
	</div>
	<div class="center_con clearfix">
		<ul class="subnav fl">
			<c:forEach items="${types}" var="type">
				<li><a href="#${type.id}">${type.name}</a></li>
			</c:forEach>
		</ul>
		<div class="slide fl">
			<ul class="slide_pics">
				<li><img src="${pagePath}/page/static/images/slide.jpg" width="760" height="270" alt="幻灯片"></li>
				<li><img src="${pagePath}/page/static/images/slide02.jpg" width="760" height="270" alt="幻灯片"></li>
				<li><img src="${pagePath}/page/static/images/slide03.jpg" width="760" height="270" alt="幻灯片"></li>
				<li><img src="${pagePath}/page/static/images/slide04.jpg" width="760" height="270" alt="幻灯片"></li>
			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
			<h2 style="padding-top: 25px; text-align: center; font-size: 20px; font-weight: bold;">最新新闻</h2>
			<ul style="padding-top: 15px; padding-left: 25px;">
				<li><a href="#">1. 欢迎访问校园二手交易网！</a></li>
				<li><a href="#">2. 校园二手交易网上线啦！</a></li>
				<li><a href="#">3. 价格便宜实惠啦！</a></li>
				<li><a href="#">4. 欢迎访问校园二手交易网！</a></li>
				<li><a href="#">5. 校园二手交易网上线啦！</a></li>
				<li><a href="#">6. 价格便宜实惠啦！</a></li>
			</ul>
		</div>
	</div>
	<div style="margin-left: 30%; width: 30%;">
		<marquee behavior="scroll" style="height: 20px; width: 760px; padding-top: 15px;" onmouseover="this.stop()" onmouseout="this.start()"> 学院公告：校园二手交易网上线啦！欢迎访问校园二手交易网！学院公告：校园二手交易网上线啦！欢迎访问校园二手交易网！学院公告：校园二手交易网上线啦！欢迎访问校园二手交易网！学院公告：校园二手交易网上线啦！欢迎访问校园二手交易网！学院公告：校园二手交易网上线啦！欢迎访问校园二手交易网！</marquee>
	</div>
	<c:forEach items="${typeTasks}" var="typeTask" varStatus="x">
		<div class="list_model">
			<div class="list_title clearfix">
				<h3 class="fl" id="${typeTask.type.id}">${typeTask.type.name}</h3>
				<div class="subtitle fl">
					<span>|</span> <a href="${pagePath}/task.do?type_id=${typeTask.type.id}&sort=0">默认</a><span>|</span> <a href="${pagePath}/task.do?type=${typeTask.type.id}&sort=1">最新</a><span>|</span> <a href="${pagePath}/task.do?type=${typeTask.type.id}&sort=2">价格</a>
				</div>
				<a href="${pagePath}/task.do?type_id=${typeTask.type.id}" class="goods_more fr" id="fruit_more">查看更多 ></a>
			</div>
			<div class="goods_con clearfix">
				<div class="goods_banner fl">
					<img src="${pagePath}/page/static/images/banner0${x.index + 1}.jpg">
				</div>
				<ul class="goods_list fl">
					<c:forEach items="${typeTask.task}" var="task">
						<li>
							<h4>
								<a href="${pagePath}/task_details.do?task_id=${task.id}">${task.name}</a>
							</h4> <a href="${pagePath}/task_details.do?task_id=${task.id}"><img src="${pagePath}${task.picture}"></a>
							<div class="prize">¥ ${task.price}</div>
						</li>
					</c:forEach>
				</ul>
			</div>
		</div>
	</c:forEach>
	<jsp:include page="footer.jsp"></jsp:include>
</body>
</html>